const {
  URL
} = require('url')

const detials = {
  tag: '', //标签
  swiper: '', //轮播图
  heroAbility: '', //英雄能力
  skillItem: {
    img: [],
    intro: []
  }, //技能说明
}
//获取详细信息
function getDetials() {
  $('.hero-tag').each(function (param) {
    detials['tag'].push(param)
  })
  $('.ui-slide__panel').each(function (param) {
    detials['swiper'].push(param)
  })
  $('.skill-item').each(function (param) {
    detials['skillItem'].img.push(param)
  })
  $('.skill-content').each(function (param) {
    detials['skillItem'].intro.push(param)
  })
}


function Hero(html, link) {

  //存放数据的容器
  if (html) {
    var $ = Cheerio.load(html, {
      ignoreWhitespace: true
    })
    var url = new URL(link);
    console.log(url.hash)
    //获取大体的描述
    getDetials();
    //获取英雄属性细节

  } else {
    console.log('未获取到数据');

  }

}
module.exports = Hero;